package com.woniuxy.carrental.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author xilei
 * @create 2021-10-02 下午 9:18
 */
@Configuration
public class MyWebMvcConfiguration {

    @Bean
    public WebMvcConfigurer webMvcConfigurer(){
        return new WebMvcConfigurer() {
            @Override
            public void addResourceHandlers(ResourceHandlerRegistry registry) {
                registry.addResourceHandler("/imagess/**").
                        addResourceLocations("file:///D:/333/imagess/");
                registry.addResourceHandler("/imagesscarpart/**").
                        addResourceLocations("file:///D:/333/imagesscarpart/");
            }
        };
    }
}
